package com.sxpi.zixun.valid.annotation;

import com.sxpi.zixun.valid.PasswordConstraintValidator;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;


/**
 * @Author: 董伟豪
 * @Date: 2022/8/25 13:20
 */
@Target({ FIELD,METHOD })
@Retention(RUNTIME)
@Constraint(validatedBy = PasswordConstraintValidator.class)
@Documented
public @interface ValidPassword {

    /**
     * 校验的错误信息，默认使用了i18n
     * @return
     */
    String message() default "{ValidPassword.password}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
